import java.util.PriorityQueue;
import java.util.Scanner;

public class LanQiaoPractice1 {
    static int path;
    static int[][] arr;
    static boolean[] vis;
    static int n;
    static boolean flag;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int q = in.nextInt();
        while(q-- > 0){
            n = in.nextInt();
            arr = new int[n][3];
            vis = new boolean[n];
            flag = false;
            path = 0;
            for (int i = 0; i < n; i++) {
                int startTime = in.nextInt();
                int endTime = in.nextInt() + startTime;
                int decent = in.nextInt();
                arr[i][0] = startTime;
                arr[i][1] = endTime;
                arr[i][2] = decent;
            }
            dfs(0);
            if(flag){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
    }

    private static void dfs(int pos) {
        if(pos == n){
            flag = true;
            return;
        }
        for (int i = 0; i < n; i++) {
            if(vis[i]) continue;
            int startTime = Math.max(path,arr[i][0]);
            if(startTime <= arr[i][1]){
                int cur = path;
                path = startTime + arr[i][2];
                vis[i] = true;
                dfs(pos + 1);
                if(flag){
                    return;
                }
                vis[i] = false;
                path = cur;
            }

        }
    }
}
